<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:mias="http://www.monsters.inc/mias">
<body>

<ui:composition template="templates/template.xhtml">
  <!--
       This page contains an edit form for editing a Kid's properties.
  -->
  <ui:define name="title">Edit kid</ui:define>
  <ui:define name="content"> 
    <h:form enctype="multipart/form-data">
      <h:panelGrid columns="4">
        <mias:field id="firstName" bean="#{editKidForm}" required="true"/>
        <mias:field id="lastName" bean="#{editKidForm}"  required="true"/>
        <mias:dateField id="birthDate" bean="#{editKidForm}"  required="true" popup="true"  />
        <mias:field id="age" bean="#{editKidForm}" readOnly="true"/>
        <mias:field id="country" bean="#{editKidForm}" />
        <mias:field id="braveness" bean="#{editKidForm}" >
          <f:convertNumber minFractionDigits="1" maxFractionDigits="1" 
                           minIntegerDigits="1" maxIntegerDigits="2" />
        </mias:field>
        <mias:dateField id="lastScared" bean="#{editKidForm}" popup="false" />
        <mias:fileUploadField id="photoFile" bean="#{editKidForm}" />
        <mias:photoField id="photoUrl" bean="#{editKidForm}"/>
        
        <h:outputText />
        <h:panelGroup>
	      <h:commandButton value="#{msg.apply}" action="#{editKidForm.apply}"/>
	      <h:commandButton value="#{msg.ok}" action="#{editKidForm.save}"/>
	      <h:commandButton value="#{msg.cancel}" action="cancel" immediate="true" />
	    </h:panelGroup>
        <h:outputText />
        <h:outputText />
      </h:panelGrid>
    </h:form>
  </ui:define>
</ui:composition>

</body>
</html>